/*
 * Phase.h
 *
 *  Created on: 23 May 2011
 *      Author: allan
 */

#ifndef PHASE_H_
#define PHASE_H_

// C++ includes
#include <iostream>
#include <functional>
using namespace std;
using namespace std::placeholders;

// GeoReact includes
#include "Utils.h"

// GeoReact forward declarations
class AqueousSolution;
class GaseousSolution;
class MineralSolution;

class Phase
{
public:
	typedef std::function<const DoubleVector(double T, double P, const DoubleVector& n)> ActivityFunction;
	
public:
	Phase();
	
	void
	SetPhaseName(const String& phaseName);
	
	void
	SetSpecies(const StringVector& species);
	
	void
	SetActivityFunction(const ActivityFunction& activityFunction);
	
	const String&
	GetPhaseName() const;
	
	const StringVector&
	GetSpecies() const;
	
	const ActivityFunction&
	GetActivityFunction() const;
	
	const DoubleVector
	Activities(double T, double P, const DoubleVector& n) const;
	
	static
	const Phase
	CreateAqueousPhase(const StringVector& aqueousSpecies);
	
	static
	const Phase
	CreateGaseousPhase(const StringVector& gaseousSpecies);
	
	static
	const Phase
	CreateMineralPhase(const StringVector& mineralSpecies);
	
private:
	String phaseName;
	StringVector species;
	ActivityFunction activityFunction;
};

#endif /* PHASE_H_ */
